package bootstrap;

import annotation.EnableHelloWorld;
import configuration.HelloWorldConfiguration;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@EnableHelloWorld
public class EnableHelloWorldBootstrap {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(EnableHelloWorldBootstrap.class)
                .web(WebApplicationType.NONE)
                .run(args);

        System.out.println(context.getBean("hello", HelloWorldConfiguration.class));
        System.out.println(context.getBean("helloWorld", String.class));

        context.close();
    }
}
